package com.neardrug.mapper;

import com.neardrug.controller.dto.NumeratorUpdateDTO;
import com.neardrug.entity.NumeratorPo;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface NumeratorMapper {
    void insert(List<NumeratorPo> numeratorPoList);

    @Select("select * from tb_numerator where task_id=#{taskId}")
    List<NumeratorPo> select(Integer taskId);

    void update(NumeratorPo numeratorPo);

    @Delete("delete from tb_numerator where id=#{id}")
    void deleteById(Integer id);

    //TODO 暂未验证功能性
    @Delete("delete from tb_numerator where task_id=#{taskId} and (num is null or num ='')")
    void delNoNumberNumeratorByTaskId(Integer taskId);
}
